<?php /* Smarty version 2.6.26, created on 2013-06-12 15:25:53
         compiled from ddnparea_index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'ddnparea_index.html', 122, false),array('function', 'cycle', 'ddnparea_index.html', 171, false),array('modifier', 'escape', 'ddnparea_index.html', 128, false),array('modifier', 'number_format', 'ddnparea_index.html', 177, false),)), $this); ?>
<?php echo '<?xml'; ?>
 version="1.0" encoding="utf-8"<?php echo '?>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('#btn-export').click(function(){	
				if(confirm('ダウンロードしますか？')){
					document.fm.csv.value="download";
					document.fm.submit();
				}
			});
			
			$('#btn-reset').click(function(){	
				location.href = document.fm.action;
			});
			
			$('#btn-add').click(function(){
				var patternid = $("#pattern_cd").val() ;
				if (patternid.length == 0){
					 alert("新聞紙を選択してください");
				 } else {
					 location.href = "ddnparea_form.php?p=" + patternid;
				 }
			});
			
			$('#btn_search').click(function(){
				var patternid = $("#pattern_cd").val() ;
				if (patternid.length == 0){
					 alert("新聞紙を選択してください");
				 } else {
					document.fm.csv.value="";
					document.fm.submit();
				 }

			});
			
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			
			$('#year4').change(function(){
				var year4 = this.value;
				var myDate = new Date();
				var nowtime =  myDate.getTime();
				$.get("mmap_week_ajax.php",{ y: year4,t : nowtime }, function(data){
					$("#week_cd").children().remove();
					$("#week_cd").append( data ); 
				});
			});	
		});
		/*
		function setS(  valnm ) {
			//alert("document.fm." +  gPara + "_name.value ='" + valnm + "'");
			eval("document.fm." +  gPara + "_name.value ='" + valnm + "'");
			$('#dialog').dialog("close");
		}
		*/
		function toPage(thepage) {
			document.fm.page.value =  thepage;
			document.fm.csv.value="";
			document.fm.submit();
		}
	
		function setSS( valcd, valnm ) {
			if (gPara == "handid") {
				document.fm.hand_cd.value = valcd;
				document.fm.hand_name.value = valnm;			
			}
			
			$('#dialog').dialog("close");
		}
		</script>
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
	</head>
	<body id="">
<?php echo $this->_tpl_vars['menu']; ?>

<?php echo $this->_tpl_vars['logout']; ?>

		<div id="container"><div class="wrapper">
			<h2>地域広告エリアマスター管理</h2>
			<ul class="submenu clearfix">
				<?php if (( ! $this->_tpl_vars['isG5'] )): ?><li><a href="ddnpwarea_index.php">地域広告情報一覧．更新</a></li><?php endif; ?>
				<?php if (( ! $this->_tpl_vars['isG5'] )): ?><li><a href="ddnpwarea_update.php">地域広告情報登録</a> </li><?php endif; ?>
				 <li>DNPエリアマスタ</li>
			</ul>
			<h3>DNPエリア情報一覧</h3>
			<form name="fm" id="fm" method="get" action="ddnparea_index.php" >
				<input type="hidden" name="page" />
				<table class="formTable">
					<tbody>
						<tr>
							<th>※新聞紙名</th>
							<td>
								<?php echo smarty_function_html_options(array('id' => 'pattern_cd','name' => 'pattern_cd','options' => $this->_tpl_vars['pattern'],'selected' => $this->_tpl_vars['forms']['pattern_cd']), $this);?>

							</td>
						</tr><tr>
							<th>取扱業者</th>
							<td>
								<input type="text" name="hand_name" class="text" value="<?php echo $this->_tpl_vars['forms']['hand_name']; ?>
" />
								<input type="hidden" name="hand_cd"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['hand_cd'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
								<button type="button" id="handid" class="btn_search" rel="hand"><span>参照</span></button>
							</td>
						</tr><tr>
							<th>更新日</th>
							<td>
								<input type="text" name="upd_f" class="text_date" value="<?php echo $this->_tpl_vars['forms']['upd_f']; ?>
" /> ～ 
								<input type="text" name="upd_t" class="text_date" value="<?php echo $this->_tpl_vars['forms']['upd_t']; ?>
" />
							</td></tr>
					</tbody>
				</table>
				<p class="button" style="text-align:right">
					<button type="button" id="btn-reset"><span>クリア</span></button>
					<button type="button" id="btn_search" class="submit"><span>絞込検索</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
			<p class="button" style="text-align:left">
				<button type="button" id="btn-add"  ><span>折込エリア追加</span></button>
			</p>
<?php if (is_numeric ( $this->_tpl_vars['page']['cnt'] )): ?>
<?php if ($this->_tpl_vars['page']['cnt'] > 0): ?>
			<p class="message"><?php echo $this->_tpl_vars['page']['cnt']; ?>
件の情報が見つかりました。</p>
			<p align="left"><?php echo $this->_tpl_vars['pageing']; ?>
</p>
			<table id="search_result" class="sortable" >
				<thead>
					<tr>
						<th><h3>パターンコード</h3></th>
						<th><h3>新聞紙名</h3></th>
						<th><h3>折込エリア名</h3></th>
						<th><h3>都心フラグ</h3></th>
						<th><h3>取扱業者</h3></th>
						<th><h3>折込エリア部数</h3></th>
						<th><h3>店舗数</h3></th>
						<th><h3>店舗部数<br>合計</h3></th>
						<th><h3>店舗/エリア<br>割合%</h3></th>
						<th><h3>店舗<br>情報</h3></th>
					</tr>
				</thead>
				<tbody>
<?php echo $this->_tpl_vars['nowindex']; ?>

<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['member']['iteration']++;
?>
					<tr class="<?php echo smarty_function_cycle(array('values' => "odd,mod",'name' => 'member'), $this);?>
">
						<td><?php echo $this->_tpl_vars['v']['pattern_cd']; ?>
</td>
						<td><?php echo $this->_tpl_vars['v']['pattern_name']; ?>
</td>
						<td><?php echo $this->_tpl_vars['v']['dist_name']; ?>
</td>
						<td class="center"><?php if (( $this->_tpl_vars['v']['center_flg'] == 1 )): ?> 都心 <?php else: ?> &nbsp; <?php endif; ?></td>
						<td><?php echo $this->_tpl_vars['v']['hand_name']; ?>
</td> 
						<td align=right><?php echo ((is_array($_tmp=$this->_tpl_vars['v']['area_nums'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
 <?php if (( $this->_tpl_vars['v']['center_flg'] == 1 )): ?><br>( <?php echo ((is_array($_tmp=$this->_tpl_vars['center']['c_area_nums'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
 ) <?php endif; ?></td>
						<td align=right><?php echo ((is_array($_tmp=$this->_tpl_vars['v']['shop_count'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
<?php if (( $this->_tpl_vars['v']['center_flg'] == 1 )): ?><br>( <?php echo ((is_array($_tmp=$this->_tpl_vars['center']['c_shop_count'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
 ) <?php endif; ?></td>
						<td align=right><?php echo ((is_array($_tmp=$this->_tpl_vars['v']['shop_nums'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
<?php if (( $this->_tpl_vars['v']['center_flg'] == 1 )): ?><br>( <?php echo ((is_array($_tmp=$this->_tpl_vars['center']['c_shop_nums'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
 ) <?php endif; ?></td>
						<td align=right><?php echo ((is_array($_tmp=$this->_tpl_vars['v']['shop_per'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
%&nbsp; <?php if (( $this->_tpl_vars['v']['center_flg'] == 1 )): ?><br>( <?php echo ((is_array($_tmp=$this->_tpl_vars['center']['c_shop_per'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
% ) <?php endif; ?></td>
						<td class="center"><a href="ddnparea_form.php?id=<?php echo $this->_tpl_vars['v']['id']; ?>
&p=<?php echo $this->_tpl_vars['v']['pattern_cd']; ?>
">[更新]</a></td>
					</tr>
<?php endforeach; endif; unset($_from); ?>
				</tbody>
			</table>
			<p align="right"><?php echo $this->_tpl_vars['pageing']; ?>
</p>
<!--			 	<p class="button">
					<button type="button" id="btn-export"  ><span>CSV基本情報</span></button>
				</p> -->
<?php else: ?>
<p class="message">条件にマッチする情報は見つかりませんでした。</p>
<?php endif; ?>
<?php else: ?>
	<p class="message">ここに検索結果が表示されます。</p>
<?php endif; ?>
<div id="dialog" >
</div>
		</div></div>
		<?php echo $this->_tpl_vars['footer']; ?>

	</body>
</html>